package com.atguigu.gmall.product.model;

import com.atguigu.gmall.base.model.BaseEntity;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Column;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * SkuInfo
 * </p>
 *
 */
@Data
@TableName("sku_info")
public class SkuInfoCDC {

	@ApiModelProperty(value = "id")
	@TableId(type = IdType.AUTO)
	private Long id;

	@ApiModelProperty(value = "创建时间")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@Column(name = "create_time")
	private Date createTime;

	@ApiModelProperty(value = "更新时间")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@Column(name = "update_time")
	private Date updateTime;

	@ApiModelProperty(value = "逻辑删除(1:已删除，0:未删除)")
	@Column(name = "is_deleted")
	private Integer isDeleted;


	@ApiModelProperty(value = "商品id")
	@Column(name = "spu_id")
	private Long spuId;

	@ApiModelProperty(value = "价格 单元：元")
	@Column(name = "price")
	private BigDecimal price;

	@ApiModelProperty(value = "sku名称")
	@Column(name = "sku_name")
	private String skuName;

	@ApiModelProperty(value = "商品规格描述")
	@Column(name = "sku_desc")
	private String skuDesc;

	@ApiModelProperty(value = "重量")
	@Column(name = "weight")
	private String weight;

	@ApiModelProperty(value = "品牌(冗余)")
	@Column(name = "tm_id")
	private Long tmId;

	@ApiModelProperty(value = "三级分类id（冗余)")
	@Column(name = "category3_id")
	private Long category3Id;

	@ApiModelProperty(value = "默认显示图片(冗余)")
	@Column(name = "sku_default_img")
	private String skuDefaultImg;

	@ApiModelProperty(value = "是否销售（1：是 0：否）")
	@Column(name = "is_sale")
	private Integer isSale;

	@TableField(exist = false)
	List<SkuImage> skuImageList;

	@TableField(exist = false)
	List<SkuAttrValue> skuAttrValueList;

	@TableField(exist = false)
	List<SkuSaleAttrValue> skuSaleAttrValueList;
}

